package com.ruoyi.delivery.service.impl;

import com.ruoyi.delivery.domain.DelDeliveryDetail;
import com.ruoyi.delivery.mapper.DelDeliveryDetailMapper;
import com.ruoyi.delivery.service.IDeliveryDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DelDeliveryDetailServiceImpl implements IDeliveryDetailService {

    @Autowired
    private DelDeliveryDetailMapper deliveryDetailMapper;

    /**
     * 根据配送单号查询配送单明细信息
     *
     * @param deliveryBatchId   配送单批次号
     * @param productName  产品名称
     * @param productBatch 产品批次
     * @param orderNumber  订单号
     * @return 配送单明细信息列表
     */
    @Override
    public List<DelDeliveryDetail> getDeliveryDetailsByDeliveryId(String deliveryBatchId , String productName, String productBatch, String orderNumber) {
        return deliveryDetailMapper.getDeliveryDetailsByDeliveryId(deliveryBatchId , productName, productBatch, orderNumber);
    }

    /**
     * 根据运单号获取配送编号
     * @param trackingNo 运单号
     * @return 配送编号 delivery_id
     */
    @Override
    public String getDeliveryIdByTrackingNo(String trackingNo) {
        return deliveryDetailMapper.getDeliveryIdByTrackingNo(trackingNo);
    }
}
